@Inject('$http')
class StaffService {
  // 人员登记
  queryRegistration(param) {
    return this.$http.post('/api/v1/identity/query', param);
  }

  deleteRegistration(param) {
    return this.$http.post('/api/v1/identity/delete', param);
  }

  queryRegistrationDetail(id) {
    return this.$http({
      url: '/api/v1/identity/get',
      method: 'GET',
      params: id,
    });
  }

  save(staff) {
    return this.$http.post('/api/v1/staff/add', staff);
  }

  get(id) {
    return this.$http({
      url: '/api/v1/staff/get',
      method: 'GET',
      params: id,
    });
  }

  query(param) {
    return this.$http.post('/api/v1/staff/query', param);
  }

  /**
   * @param  {Array<String>}
   * @return {[type]}
   */
  delete(ids) {
    return this.$http.post('/api/v1/staff/delete', ids);
  }

  update(staff) {
    return this.$http.post('/api/v1/staff/update', staff);
  }

  // 人员进场
  saveInTime(param) {
    return this.$http.post('/api/v1/staffInOut/in/add', param);
  }

  // 人员出场
  saveOutTime(param) {
    return this.$http.post('/api/v1/staffInOut/out/add', param);
  }

  // 人员教育培训
  queryTraining(id) {
    return this.$http.post('/api/v1/safeActivity/training/queryByStaff', id);
  }

  // 人员技术交底
  queryDisclosure(id) {
    return this.$http.post('/api/v1/safeActivity/disclosure/queryByStaff', id);
  }

  // 人员进出场记录
  queryInOut(id) {
    return this.$http.post('/api/v1/staffInOut/query', id);
  }

  // 人员参保资料
  queryDocument(param) {
    return this.$http.post('/api/v1/staff/document/query', param);
  }

  deleteDocument(ids) {
    return this.$http.post('/api/v1/staff/document/delete', ids);
  }

  updateDocument(param) {
    return this.$http.patch('/api/v1/staff/document/update', param);
  }

  saveDocument(param) {
    return this.$http.post('/api/v1/staff/document/add', param);
  }

  getDocument(id) {
    return this.$http({
      url: '/api/v1/staff/document/get',
      method: 'GET',
      params: id,
    });
  }
}

export default StaffService;
